package cn.com.huzo.model.entities.purchase;

import huzofw.model.entities.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 物料采购合同主记录实体类
 * <p>
 * @author 吴旭
 */
public class PoHeaderEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = 9195392713411181321L;
    private Long HeaderId;
    private String PoNo;                      // 订单合同号
    private String StyleNo;                   // 款号
    private Integer BillTypeId;               // 合同类型ID
    private String BillTypeName;              // 合同类型名
    private Long SupplierId;                  // 供应商
    private String SupplierNo;                // 供应商编号
    private String Address;                   // 供应商地址
    private String SupplierName;              // 供应商名
    private String Attn;                      // 联系人
    private String Tel;                       // 联系电话
    private String Fax;                       // 传真
    private String PerformedPlace;            // 合同履行地
    private Timestamp SignedDate;             // 落单日期
    private Timestamp OrderArrivalDate;       // 订单到货日期
    private String GramWeight;                // 克重
    private String TermsOfPayment;            // 付款条件
    private String QuantityOfLimited;         // 数量许可
    private Integer PurchasedBy;              // 采购担当
    private String PurchasedByName;
    private String QualityStandard;           // 品质要求
    private Integer CurrencyId;               // 币种
    private String CurrencyName;
    private String CurrencySymbol;
    private Integer TaxRateId;                // 税率ID
    private Double TaxRate;                   // 税率
    private String TaxRateText;               // 税率显示（13%，16%等等）
    private Boolean FreightFlag;              // 是否包含运费
    private String Description;               // 说明
    private Short IsSupplierGroupMember;      // 是否为该供应商权限分组成员
    private Boolean QuotedFlag;               // 被入库引用
    private Short PrintFlag;                  // 打印次数

    public Long getHeaderId() {
        return HeaderId;
    }

    public String getPoNo() {
        return PoNo;
    }

    public String getStyleNo() {
        return StyleNo;
    }

    public Integer getBillTypeId() {
        return BillTypeId;
    }

    public String getBillTypeName() {
        return BillTypeName;
    }

    public Long getSupplierId() {
        return SupplierId;
    }

    public String getSupplierNo() {
        return SupplierNo;
    }

    public String getAddress() {
        return Address;
    }

    public String getSupplierName() {
        return SupplierName;
    }

    public String getAttn() {
        return Attn;
    }

    public String getTel() {
        return Tel;
    }

    public String getFax() {
        return Fax;
    }

    public String getPerformedPlace() {
        return PerformedPlace;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getSignedDate() {
        return SignedDate;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getOrderArrivalDate() {
        return OrderArrivalDate;
    }

    public String getGramWeight() {
        return GramWeight;
    }

    public String getTermsOfPayment() {
        return TermsOfPayment;
    }

    public String getQuantityOfLimited() {
        return QuantityOfLimited;
    }

    public Integer getPurchasedBy() {
        return PurchasedBy;
    }

    public String getPurchasedByName() {
        return PurchasedByName;
    }

    public String getQualityStandard() {
        return QualityStandard;
    }

    public Integer getCurrencyId() {
        return CurrencyId;
    }

    public String getCurrencyName() {
        return CurrencyName;
    }

    public String getCurrencySymbol() {
        return CurrencySymbol;
    }

    public Integer getTaxRateId() {
        return TaxRateId;
    }

    public Double getTaxRate() {
        return TaxRate;
    }

    public String getTaxRateText() {
        return TaxRateText;
    }

    public Boolean getFreightFlag() {
        return FreightFlag;
    }

    public String getDescription() {
        return Description;
    }

    public Short getIsSupplierGroupMember() {
        return IsSupplierGroupMember;
    }

    public Boolean getQuotedFlag() {
        return QuotedFlag;
    }

    public Short getPrintFlag() {
        return PrintFlag;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public void setPoNo(String PoNo) {
        this.PoNo = PoNo;
    }

    public void setStyleNo(String StyleNo) {
        this.StyleNo = StyleNo;
    }

    public void setBillTypeId(Integer BillTypeId) {
        this.BillTypeId = BillTypeId;
    }

    public void setBillTypeName(String BillTypeName) {
        this.BillTypeName = BillTypeName;
    }

    public void setSupplierId(Long SupplierId) {
        this.SupplierId = SupplierId;
    }

    public void setSupplierNo(String SupplierNo) {
        this.SupplierNo = SupplierNo;
    }

    public void setAddress(String Address) {
        this.Address = Address;
    }

    public void setSupplierName(String SupplierName) {
        this.SupplierName = SupplierName;
    }

    public void setAttn(String Attn) {
        this.Attn = Attn;
    }

    public void setTel(String Tel) {
        this.Tel = Tel;
    }

    public void setFax(String Fax) {
        this.Fax = Fax;
    }

    public void setPerformedPlace(String PerformedPlace) {
        this.PerformedPlace = PerformedPlace;
    }

    public void setSignedDate(Timestamp SignedDate) {
        this.SignedDate = SignedDate;
    }

    public void setOrderArrivalDate(Timestamp OrderArrivalDate) {
        this.OrderArrivalDate = OrderArrivalDate;
    }

    public void setGramWeight(String GramWeight) {
        this.GramWeight = GramWeight;
    }

    public void setTermsOfPayment(String TermsOfPayment) {
        this.TermsOfPayment = TermsOfPayment;
    }

    public void setQuantityOfLimited(String QuantityOfLimited) {
        this.QuantityOfLimited = QuantityOfLimited;
    }

    public void setPurchasedBy(Integer PurchasedBy) {
        this.PurchasedBy = PurchasedBy;
    }

    public void setPurchasedByName(String PurchasedByName) {
        this.PurchasedByName = PurchasedByName;
    }

    public void setQualityStandard(String QualityStandard) {
        this.QualityStandard = QualityStandard;
    }

    public void setCurrencyId(Integer CurrencyId) {
        this.CurrencyId = CurrencyId;
    }

    public void setCurrencyName(String CurrencyName) {
        this.CurrencyName = CurrencyName;
    }

    public void setCurrencySymbol(String CurrencySymbol) {
        this.CurrencySymbol = CurrencySymbol;
    }

    public void setTaxRateId(Integer TaxRateId) {
        this.TaxRateId = TaxRateId;
    }

    public void setTaxRate(Double TaxRate) {
        this.TaxRate = TaxRate;
    }

    public void setTaxRateText(String TaxRateText) {
        this.TaxRateText = TaxRateText;
    }

    public void setFreightFlag(Boolean FreightFlag) {
        this.FreightFlag = FreightFlag;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    public void setIsSupplierGroupMember(Short IsSupplierGroupMember) {
        this.IsSupplierGroupMember = IsSupplierGroupMember;
    }

    public void setQuotedFlag(Boolean QuotedFlag) {
        this.QuotedFlag = QuotedFlag;
    }

    public void setPrintFlag(Short PrintFlag) {
        this.PrintFlag = PrintFlag;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof PoHeaderEntity)) {
            return false;
        }

        final PoHeaderEntity that = (PoHeaderEntity) o;

        return new EqualsBuilder()
                .append(this.getHeaderId(), that.getHeaderId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getHeaderId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
